local skel = fk.CreateSkill {
  name = "lb__jiangshen",
  tags = { Skill.Limited },
}

Fk:loadTranslationTable {
  ["lb__jiangshen"] = "降神",
  --[":lb__jiangshen"] = "<b>限定技</b>，出牌阶段，你可以令所有横置角色将 “<b>衣匠</b>”作为副将。",

  [":lb__jiangshen"] = "<b>限定技</b>，出牌阶段，你可以令所有没有副将的横置角色将 “<b>衣匠</b>”作为副将。",

  ["#lb__jiangshen"] = "降神：你可以令所有横置角色将 “<b>衣匠</b>”作为副将",

  ["$lb__jiangshen1"] = "你我的命运，由此交织。",
  ["$lb__jiangshen2"] = "万缕千丝，在我指尖。",
}

skel:addEffect("active", {
  prompt = "#lb__jiangshen",
  can_use = function(self, player)
    return player:usedSkillTimes("lb__jiangshen", Player.HistoryGame) == 0
        and table.find(Fk:currentRoom().alive_players, function(to)
          return to.chained
        end)
  end,
  card_filter = Util.FalseFunc,
  target_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    for _, to in ipairs(room:getAlivePlayers()) do
      if not to.dead and to.chained and (not to.deputyGeneral or to.deputyGeneral == "") then
        room:changeHero(to, "lb__yijiang", false, true, true, false)
      end
    end
  end,
})

return skel
